#pragma once

#include <memory>
#include <YSimpleSystem/YIntrusive_Ptr.h>
#include <functional>

#ifdef YSIMPLENETWORK_EXPORTS
#define YSIMPLENETWORK_EXPORTS_API __declspec(dllexport) 
#else
#define YSIMPLENETWORK_EXPORTS_API __declspec(dllimport) 
#endif

#define RELEASE_FUNCTOR(type) std::function<void(type*)>

namespace ysimple_network
{

	struct INetworkFactory;
	struct ITCPSession;
	struct IUDPSession;
	struct YPacketBlock;
	struct YPacket;

	typedef ysimple_system::intrusive_ptr<ITCPSession>	TCP_SESSION_SPTR;
	typedef ysimple_system::intrusive_ptr<IUDPSession>	UDP_SESSION_SPTR;
	typedef std::shared_ptr<YPacketBlock>	PACKETBLOCK_SPTR;
	typedef std::shared_ptr<YPacket> PACKET_SPTR;
	

	YSIMPLENETWORK_EXPORTS_API bool init();
	YSIMPLENETWORK_EXPORTS_API INetworkFactory& getFactory();

}